Development of a real-time charging technology creates good conditions for an operator to further segment a market. For example, the operator may define various monthly packages corresponding to different durations using the real-time charging technology, to satisfy requirements of various types of users. For another example, the operator may divide each day into different time segments according to network usage situations, and set different charging tariffs for different time segments. For example, a high tariff is set for a time segment during which a network is busy (for example, from 20 o'clock to 23 o'clock every day); and a low tariff is set and even no fee is charged for a time segment during which the network is idle (for example, from 6 o'clock to 8 o'clock every day).
However, a charging message reporting mechanism of the existing real-time charging technology still needs improvement, and therefore unexpected situations may occur in some cases. For example, as charging policies of an operator are increasingly complicated, the existing real-time charging technology may cause a user account overdraft in some cases, and therefore the operator is likely to suffer a loss. A reason for this phenomenon is described in the following with reference to FIG. 1.
FIG. 1 is a signaling diagram of an existing real-time charging method 100. In a scenario shown in FIG. 1, 18 o'clock is a tariff switch point, that is, a tariff is switched at 18 o'clock, where a tariff before the switch is 0 yuan/million (M), that is, no fee is charged before the switch; and a tariff after the switch is 1 yuan/M. A user sends a login request to an access device at seventeen fifty-one when an account balance of the user is 10 yuan.
Step 102: The access device sends an access request to an authentication device in response to the login request of the user, so as to request a granted service unit for the user.
Step 104: The authentication device sends an initial credit control request (CCR {Init}) to a charging device, where the initial credit control request carries a requested service unit (RSU) of 100 M.
Then, the charging device determines a current available service unit according to a current account balance of the user and a current tariff. Because the user's current account balance is 10 yuan, according to the current tariff of 0 yuan/M, the current available service unit is infinite. That is, the user is able to use a service unrestrictedly until the end of a free time segment.
Step 106: The charging device sends an initial credit control answer (CCA {Init}) to the authentication device. Because the determined current available service unit is infinite, which is greater than the requested service unit of 100 M, a granted service unit (GSU) carried in the CCA {Init} is set to be the requested service unit of 100 M according to existing real-time charging technical specifications.
Step 108: The authentication device determines that the granted service unit of 100 M carried in the CCA {Init} is the requested service unit of 100 M, and therefore grants the entire service unit of 100 M to the user. Further, the authentication device sends an access response to the access device. The access response carries parameters VT=90 M and VQ=100 M, where VT is a volume threshold and VQ is a volume quota. VQ=100 M indicates that the granted service unit is 100 M, and VT=90 M indicates that the access device needs to request a granted service unit again for the user when detecting that a used service unit of the user reaches 90 M.
In addition, the access response further includes a tariff switch interval (TSI), which is used to indicate a time interval between a current moment and the tariff switch point, so as to prompt the access device to separately report used service units which are generated before and after the tariff switch point, respectively. TSI=540 s indicates that the interval between the current moment and the tariff switch point is 540 seconds.
Step 110: When the used service unit of the user reaches 90 M, the access device sends an online access request to the authentication device, where the online access request carries the used service unit of 90 M (the used service unit is also carried in the VQ parameter), and indicates that a used service unit after the tariff switch point of 18 o'clock is 40 M in the used service unit of 90 M, that is, a volume used after tariff switch (VUATS) is 40 M.
Step 112: The authentication device notifies the charging device of the foregoing used service units using an update credit control request (CCR {Update}), where the foregoing used service units are carried in a USU (used service unit). Because the tariff is switched, two USUs are reported simultaneously according to existing technical specifications related to real-time charging, where a USU (TCU=2) represents a total used service unit, namely, 90 M, in a latest charging period, a USU (TCU=1) represents the used service unit after the tariff switch, namely, 40 M, in the latest charging period, and TCU stands for tariff change usage identifier.
Then, the charging device performs fee deduction according to the foregoing used service units. A used service unit generated before 18 o'clock is 50 M (90 M−40 M), and a fee of 0 yuan is generated according to the tariff of 0 yuan/M before 18 o'clock; and a service unit generated after 18 o'clock is 40 M, and a fee of 40 yuan is generated according to the tariff of 1 yuan/M after 18 o'clock. Therefore, 40 yuan is deducted totally. Because the previous user account balance is 10 yuan, a user account balance after fee deduction is −30 yuan, and the user account is overdrawn. Therefore, the available service unit of the user is zero.
Step 114: The charging device calculates a granted service unit according to the user account balance after fee deduction. Because the user account is overdrawn, the calculated granted service unit is 0. The charging device returns an update credit control answer (CCA {Update}) to the authentication device, where a carried GSU is 0 M, namely, the granted service unit is 0.
Step 116: The authentication device returns an online access response to the access device, and notifies the access device that the granted service unit is zero.
When the access device reports the used service unit of 90 M in step 110, among the service unit of 100 M previously granted by the charging device to the user, there are still 10 M (100 M−90 M) left. In some existing real-time charging technical solutions, although the user account is overdrawn, and the available service unit of the user is zero, the access device still permits the user to continue to use up the remaining granted service unit of 10 M, and after the remaining service unit is used up, instructs the charging device to charge for the remaining granted service unit. Therefore, in step 118, the access device reports a stop online access request (Online Access Request (stop)) to the authentication device, and reports the used service unit of 10 M, where the used service unit is carried in the VQ parameter.
Step 120: The authentication device reports a terminate credit control request (CCR {Term}) to the charging device according to the stop online access request from the access device, where the used service unit of 10 M is carried in the USU parameter.
Step 122: The charging device performs fee deduction for the user account according to the used service unit carried in the terminate credit control request sent by the authentication device, and then returns a terminate credit control answer (CCA {Term}) to the authentication device. Because the user account is overdrawn previously, an overdraft of the user account further increases after this fee deduction.
Step 124: The authentication device returns a stop online access response (stop) to the access device according to the terminate credit control answer from the charging device.
It is not that hard to find out from the foregoing process that the user has used a service unit of 50 M when the tariff switch point (18 o'clock) is reached, and that a service usage fee of the user is 0 yuan according to the tariff of 0 yuan/M before 18 o'clock. Therefore, the user account balance is still 10 yuan at 18 o'clock. According to the tariff after 18 o'clock (1 yuan/M), a service unit available to the user based on the user account balance after 18 o'clock is only 10 M. However, in an actual using process, the user uses a service unit of 40 M within just three minutes from 18 o'clock to three past eighteen, and the service unit is far more than the service unit of 10 M available to the user based on the user account balance, therefore causing an overdraft of 30 yuan in the user account. In addition, a subsequent practice that the access device permits the user to continue to use up the remaining granted service unit may further increase the overdraft, which probably causes a certain loss to the operator.